package secondStage.part4.特殊操作流;

import java.io.Serializable;

/**
 * @ClassName: [Student]
 * @Description: 学生类
 * @Author: [黄劲松]
 * @CreateDate: [2021-04-05]
 * @Version: [v1.0]
 */
public class Student implements Serializable {//实现Serializable该接口的类可以序列化和反序列化
    private static final long serialVersionUID=42L;//给定序列化ID
    private String name;
//    private int age;
    private transient int age;//transient关键字修饰后，成员变量不参与序列化

    public Student() {
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
